﻿@{
    var title = "Dynamic LINQ Documentation";
    
    if (!String.IsNullOrWhiteSpace(ViewBag.Title))
    {
        title = ViewBag.Title + " - " + title;
    }

    var urlHome = Url.Action("Index", "Home");
    var urlLibrary = Url.Action("Index", "Library");
    var urlExpressions = Url.Action("Index", "Expression");
    var urlDownloads = Url.Action("Downloads", "Home");
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@title</title>
    @if (ViewBag.MetaDescription != null)
    {
    <meta name="description" content="@ViewBag.MetaDescription" />
    }
    @if (ViewBag.MetaKeywords != null)
    {
    <meta name="keywords" content="@String.Join(", ", (IEnumerable<string>)ViewBag.MetaKeywords)" />
    }
    @Styles.Render("~/Content/css")
    @if (!Request.Url.IsLoopback)
    {
        @Html.Partial("_PartialGoogleAnalytics")
    }
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Dynamic LINQ", "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li class="@Html.IsActive(urlHome)"><a href="@urlHome">Home</a></li>
                    <li class="@Html.IsActive(urlLibrary, true)"><a href="@urlLibrary">Library</a></li>
                    <li class="@Html.IsActive(urlExpressions, true)"><a href="@urlExpressions">Expressions</a></li>
                    <li class="@Html.IsActive(urlDownloads, true)"><a href="@urlDownloads">Downloads</a></li>
                    @*<li class="disabled">Samples</li>*@
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><gcse:search linktarget="_parent"></gcse:search></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        <div class="row">
            <div class="col-md-12">
                @RenderBody()
            </div>
        </div>
    </div>

    <div class="container body-footer">
        <footer>
            <div class="row">
                <div class="col-xs-6">
                    @Html.ActionLink("Project Info", "Info", "Home", null, new { @class = "btn btn-success btn-xs" })
                </div>
                <div class="col-xs-6 text-right">
                    <button onclick="location.href='@Settings.GitHubIssues'" class="btn btn-danger btn-xs">Report an issue</button>
                </div>
            </div>
        </footer>
    </div>

    @Scripts.Render("~/bundles/js")
    @RenderSection("scripts", required: false)
</body>
</html>
